﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

public partial class liulan : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            BindData();//调用数据源
            BindData1();
        }
    }
    protected void BindData()
    {
        car tmp = new car();
        GridView1.DataSource = tmp.GetAllCar().Tables[0].DefaultView;//绑定数据源
        GridView1.DataBind();
    }
    protected void BindData1()
    {
        car tmp = new car();
        GridView2.DataSource = tmp.GetAllCar().Tables[0].DefaultView;//绑定数据源
        GridView2.DataBind();
    }
}